<%@ page language="java" contentType="text/html;charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<%@ include file="../common/header.jsp"%>
</head>
<body>

	<div class="container " style="margin-top: 20px">
		<%@ include file="../common/top.jsp"%>
		<div class="row">
			<div class="col-sm-3">
				<c:set var="menu" value="permission" />
				<%@ include file="../common/menu.jsp"%>
			</div>
			<div class="col-sm-9">
				<div class="row">
					<div class="col-sm-12">
						<h1 class="page-head-line">权限管理</h1>
					</div>
				</div>

				<form class="form-inline" id="searchForm"
					action="/permission/list.do" method="post">
					<input type="hidden" name="currentPage" id="currentPage" value="1">
					<a role="button" data-url="/permission/reload.do"
						class="btn btn-success reload"> <span
						class="glyphicon glyphicon-refresh"></span> 加载权限
					</a>
				</form>

				<table class="table table-striped table-hover">
					<tr>
						<th>编号</th>
						<th>权限名称</th>
						<th>权限表达式</th>
					</tr>
					<c:forEach var="entity" items="${pageInfo.list}">
						<tr>
							<td>${entity_index + 1}</td>
							<td>${entity.name}</td>
							<td>${entity.expression}</td>
						</tr>
					</c:forEach>
				</table>
				<%@ include file="../common/page.jsp"%>
			</div>
		</div>
	</div>
	<script>
    $(function () {
        //加载权限按钮绑定点击事件
        $(".reload").click(function () {
            var url = $(this).data("url");
            $.messager.confirm("温馨提示", "亲,加载权限耗时很长,确定要重新加载吗", function () {
                $.get(url, function (data) {
                    doSuccess();
                });
            });
        });
    });
</script>
</body>
</html>